import uvicorn
from fastapi import FastAPI
from typing import Optional
from pydantic import BaseModel

app = FastAPI()


# 请求体模型

@app.get("/items/")
def update_times(m: Optional[str] = None):
    results = {"items": [{"oneid": "shanghai"}, {"two": "beijing"}]}
    if m:
        results.update({'shanghai': m})
    return results





if __name__ == '__main__':
    uvicorn.run(app="main:app", host="127.0.0.1", port=8000, reload=True, debug=True)
